package com.topplus.maleant.openglstu;

import android.opengl.GLSurfaceView;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;

public class MainActivity extends BaseActivity {

    private GLSurfaceView glSurfaceView;
    private boolean rendererSet = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initGlSurface();
    }

    private void initGlSurface() {
        if (isSupportESGL2()) {

            glSurfaceView = new GLSurfaceView(this);
            glSurfaceView.setEGLContextClientVersion(2);
//            glSurfaceView.setRenderer();
            rendererSet = true;
        } else {
            Toast.makeText(this, "这个设备不支持opengl2.0", Toast.LENGTH_SHORT).show();
        }
    }
}
